﻿using System;
using System.Web.UI;

using SY.Uap.Entity;

namespace SY.WebSite.Web
{
    /// <summary>
    /// 模板页基类
    /// </summary>
    public class BaseMaster : MasterPage
    {
        //private Settings _settings;

        /// <summary>
        /// 可能为null，使用的时候要记得判断
        /// </summary>
        public User CurrentUser { get; private set; }

        public bool IsLogin { get; private set; }

        public Settings Settings
        {
            get { return Common.Settings; }
        }

        protected override void OnInit(EventArgs e)
        {
            //NLog.Log.DefaultLog().Write("OnInit");
            base.OnInit(e);

            CurrentUser = Auth.GetUser();
            IsLogin = CurrentUser != null;
        }

        /*/// <summary>
        /// 获取当前的Action值
        /// </summary>
        protected string Action
        {
            get
            {
                return Tools.Web.Request.GetQueryString("action");
            }
        }*/


        public string R
        {
            get
            {
                return Common.Version;
            }
        }
    }
}